package org.igeek.config.BeanPostProcessor;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

/**
 * @package org.igeek.config.BeanPostProcessor
 * @Description
 * @Author LittlePunk [296526219@qq.ccom]
 * @Version 2022.1
 * @Date 2023/11/14 15:21
 */
public class MainTest {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(MyConfig.class);
        String[] beanDefinitionNames = ac.getBeanDefinitionNames();
        //System.out.println(Arrays.toString(beanDefinitionNames));
        System.out.println("---------------------");

        Dog dog = ac.getBean("dog", Dog.class);
        Tiger tiger = ac.getBean("tiger", Tiger.class);
        //发现  dog被成功干涉了  dog = Dog{name = 柯基, age = 3}
        System.out.println("dog = " + dog);
        System.out.println("tiger = " + tiger);
    }
}
